# _*_ coding: utf-8 _*_
# @Time : 2021/10/20 11:00
# @Author : Mr.Cin
# @File : test
# @Project : opencv

import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# 1. 璇诲彇鍥惧儚
img = cv.imread("image/1.jpg", 0)
# 2. 鏄剧ず鍥惧儚
# 2.1 鍒╃敤opencv灞曠ず鍥惧儚
# cv.imshow("image", img)
# 2.2 鍦╩atplotplotlib涓�灞曠ず鍥惧儚
plt.imshow(img, cmap=plt.cm.gray)
# plt.title("鍖归厤缁撴灉"), plt.xticks([]), plt.yticks([])
plt.show()
# k = cv.waitKey(0)
# 3. 淇濆瓨鍥惧儚
cv.imwrite("image/2.png", img)


